/*
 * 文 件    名:  ContentURI.java
 * 创建日期:  2012-9-28上午11:55:01
 * 版          权:  Epro Technologies Co., Ltd. Copyright 2011-2012,  All rights reserved
 * 作          者:  cl073
 */
package com.weipu.common.facade.content;

import android.net.Uri;

/**
 * @author cl073
 * @version [版本号, 2012-9-28]
 * @Description 内容表结构及内容提供者uri 对数据内容查询、修改的操作的uri应当都从此类中读取以便管理
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class ContentURI {
    private ContentURI() {
    }

    public static final String BASE = "com.weipu.common.facade.content.basecontentprovider";

    public static final String BASE_URI = "content://" + BASE;

    public static final Uri CONTENT_URI_RAW_SQL = Uri.parse(BASE_URI + "/raw");

    // 购物车数据库表结构
    public static final class ContentMyCart {
        private ContentMyCart() {
        }

        public static final Uri CONTENT_URI_ALL = Uri.parse(BASE_URI + "/menu");

        public static final Uri CONTENT_URI_BY_ID = Uri.parse(BASE_URI + "/menu/id");

        public static final String TABLE_NAME = "tbl_mycart";
        //isFavorite varchar(50) , mediumPictureURL varchar(50)
        public static final String TABLE_CREATE =
                "create table tbl_mycart(_id integer primary key autoincrement, sku integer,shortHeadLine1 varchar(50),price float,quantity integer ,smallPictureURL varchar(50),freeShipping integer, listprice float, mediumPictureURL varchar(50));";

        public static final String TABLE_DROP = "drop table if exists tbl_mycart;";
    }

    // 搜索历史记录
    public static final class ContentSearchHistory {
        private ContentSearchHistory() {
        }

        public static final Uri CONTENT_URI_ALL = Uri.parse(BASE_URI + "/searchhistory");

        public static final Uri CONTENT_URI_BY_ID = Uri.parse(BASE_URI + "/searchhistory/id");

        public static final String TABLE_NAME = "tbl_searchhistory";

        public static final String TABLE_CREATE =
                "create table tbl_searchhistory(_id integer primary key autoincrement, searchhistoryId integer,historyname varchar(50),searchTime long);";

        public static final String TABLE_DROP = "drop table if exists tbl_searchhistory;";
    }

    // 浏览历史数据库表结构
    public static final class ContentBrowsingHistory {
        private ContentBrowsingHistory() {
        }

        public static final Uri CONTENT_URI_ALL = Uri.parse(BASE_URI + "/browsinghistory");

        public static final Uri CONTENT_URI_BY_ID = Uri.parse(BASE_URI + "/browsinghistory/id");

        public static final String TABLE_NAME = "tbl_browsinghistory";
        //mediumPictureURL varchar(50)
        public static final String TABLE_CREATE =
                "create table tbl_browsinghistory(_id integer primary key autoincrement, sku integer,shortHeadLine1 varchar(50),smallPictureURL varchar(50),price float,oldprice float,reviewCount int,productRating float, mediumPictureURL varchar(50));";

        public static final String TABLE_DROP = "drop table if exists tbl_browsinghistory;";
    }

    // 栏目数据库表结构
    public static final class CategoryList {
        private CategoryList() {
        }

        public static final Uri CONTENT_URI_ALL = Uri.parse(BASE_URI + "/categorylist");

        public static final Uri CONTENT_URI_BY_ID = Uri.parse(BASE_URI + "/categorylist/id");

        public static final String TABLE_NAME = "tbl_categorylist";

        public static final String TABLE_CREATE =
                "create table tbl_categorylist(_id integer primary key autoincrement, category_id integer, parent_id text,name text,update_time long);";

        public static final String TABLE_DROP = "drop table if exists tbl_categorylist;";
    }

    // 产品数据库表结构
    public static final class ProductList {
        private ProductList() {
        }

        public static final Uri CONTENT_URI_ALL = Uri.parse(BASE_URI + "/productlist");

        public static final Uri CONTENT_URI_BY_ID = Uri.parse(BASE_URI + "/productlist/id");

        public static final String TABLE_NAME = "tbl_productlist";

        public static final String TABLE_CREATE =
                "create table tbl_productlist(_id integer primary key autoincrement, sku integer, product_name text,language text,currency_code  text,price float,listp_rice float,entity_id integer, introduction text, specification text,review_count integer,product_rating float,photos_count integer,pic_small_url blob,pic_medium_url blob,pic_big_url blob,web_url text,free_shipping integer,relate_free_shipping blob,type text,update_time long);";

        public static final String TABLE_DROP = "drop table if exists tbl_productlist;";
    }

    // 广告数据库表结构
    public static final class HotWord {
        private HotWord() {
        }

        public static final Uri CONTENT_URI_ALL = Uri.parse(BASE_URI + "/hotword");

        public static final Uri CONTENT_URI_BY_ID = Uri.parse(BASE_URI + "/hotword/id");

        public static final String TABLE_NAME = "tbl_hot_word";

        public static final String IF_EXISTS_TABLE_CREATE = "CREATE TABLE IF NOT EXISTS tbl_hot_word(_id integer primary key autoincrement, hot_word_id integer, hot_word text)";

        public static final String TABLE_CREATE =
                "create table tbl_hot_word(_id integer primary key autoincrement, hot_word_id integer, hot_word text)";

        public static final String TABLE_DROP = "drop table if exists tbl_hot_word;";
    }

    // 广告数据库表结构
    public static final class HomeModuleData {
        private HomeModuleData() {
        }

        public static final Uri CONTENT_URI_ALL = Uri.parse(BASE_URI + "/modulelist");

        public static final Uri CONTENT_URI_BY_ID = Uri.parse(BASE_URI + "/modulelist/id");

        public static final String TABLE_NAME = "tbl_home_modulelist";

        public static final String TABLE_CREATE =
                "create table tbl_home_modulelist(_id integer primary key autoincrement, active_id text, active_name text, active_type integer, active_sort long, active_linkUrl text,active_phoneImg text,active_padImg text,active_sku integer , active_linkType integer,module_name text,module_sort long,module_type integer,module_isShow integer );";
        public static final String IF_EXISTS_TABLE_CREATE = "CREATE TABLE IF NOT EXISTS tbl_home_modulelist(_id integer primary key autoincrement, active_id text, active_name text, active_type integer, active_sort long, active_linkUrl text,active_phoneImg text,active_padImg text,active_sku integer , active_linkType integer,module_name text,module_sort long,module_type integer,module_isShow integer )";
        public static final String TABLE_DROP = "drop table if exists tbl_home_modulelist;";
    }

    // 一键过滤据库表结构
    public static final class OnekeyFilterList {
        private OnekeyFilterList() {
        }

        public static final Uri CONTENT_URI_ALL = Uri.parse(BASE_URI + "/onekeyfilter");

        public static final Uri CONTENT_URI_BY_ID = Uri.parse(BASE_URI + "/onekeyfilter/id");

        public static final String TABLE_NAME = "tbl_onekeyfilter";

        public static final String TABLE_CREATE =
                "create table tbl_onekeyfilter(_id integer primary key autoincrement,customerID long,categoryID integer,categoryName text,isShow varchar(10));";

        public static final String TABLE_DROP = "drop table if exists tbl_onekeyfilter;";
    }

}
